PROGRAM PLC_PRG
    VAR
        c_counter_inst : counter; (* C语言实现的counter示例 *)
        cpp_counter_inst : cpp_counter; (* C++语言实现的counter示例 *)
        cpp_assert_counter_inst : cpp_asset_counter; (* C++语言复用已有代码实现的counter示例 *)
        st_counter_inst : st_counter; (* ST语言实现的counter示例 *)
        rust_counter_inst : rust_counter;

        res1, res2, res3, res4, res5 : DINT := 0;
    END_VAR

    IF res1 < 1 THEN
        greeting_from_c('Hello PLC'); 
    END_IF;

    greeting_from_rust('Hello PLC');

    c_counter_inst(IN1 := 1, CNT => res1);
    cpp_counter_inst(IN1 := 1, CNT => res2);
    cpp_assert_counter_inst(IN1 := 1, CNT => res3);
    st_counter_inst(IN1 := 1, CNT => res4);
    rust_counter_inst(IN1 := 1, CNT => res5);

END_PROGRAM
